
<%@ page import="com.consorzioimpresa.resuite.domain.Immobile"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="springSecurityUI" />
<g:set var="entityName"
	value="${message(code: 'immobile.label', default: 'Immobile')}" />
<title>Lista Immobili</title>
</head>
<body>
	<div class="nav">
		<%--            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>--%>
		<span class="menuButton"><g:link class="create"
				action="create">
				Nuovo Immobile
			</g:link></span>



	</div>
	<div class="body" align="center">
		<h1>
			Lista Immobili
		</h1>
		<div align="center">

			<g:form url='[controller:"search", action: "search"]'
				id="searchableForm" name="searchableForm" method="get">
				<g:textField name="q" value="${params.q}" size="50" />
				<g:hiddenField name="clazz"
					value="com.consorzioimpresa.resuite.domain.Immobile" size="50" />
				<g:hiddenField name="entity" value="immobile" size="50" />
				<input type="submit" value="Cerca" />
			</g:form>
			<br /> <br />
		</div>

		<g:if test="${flash.message}">
			<div class="message">
				${flash.message}
			</div>
		</g:if>
		<div class="list">
			<table style="width: 100%">
				<thead>
					<tr>

						<g:sortableColumn property="id"
							title="${message(code: 'immobile.id.label', default: 'Id')}" />
						<g:sortableColumn property="nome"
							title="${message(code: 'immobile.CAP.label', default: 'Nome')}" />
						<g:sortableColumn property="descrizione"
							title="${message(code: 'immobile.CAP.label', default: 'Descrizione')}" />
						<g:sortableColumn property="tipologia"
							title="${message(code: 'immobile.CAP.label', default: 'Tipologia')}" />
						<g:sortableColumn property="zona"
							title="${message(code: 'immobile.CAP.label', default: 'Zona')}" />
						<g:sortableColumn property="CAP"
							title="${message(code: 'immobile.CAP.label', default: 'CAP')}" />
						<g:sortableColumn property="indirizzo"
							title="${message(code: 'immobile.metriQuadri.label', default: 'Indirizzo')}" />
						<g:sortableColumn property="metriQuadri"
							title="${message(code: 'immobile.metriQuadri.label', default: 'Metri Quadri')}" />
						<g:sortableColumn property="prezzo"
							title="${message(code: 'immobile.metriQuadri.label', default: 'Prezzo')}" />
						<g:sortableColumn property="agente"
							title="${message(code: 'immobile.CAP.label', default: 'Agente')}" />
						<th><g:message code="immobile.anteprima.label"
								default="Anteprima" /></th>


					</tr>
				</thead>
				<tbody>
					<g:each in="${immobileInstanceList}" status="i"
						var="immobileInstance">
						<tr class="${(i % 2) == 0 ? 'odd' : 'even'}" style="vertical-align: middle;">

							<td style="vertical-align: middle;"><g:link action="show" id="${immobileInstance.id}">
									${fieldValue(bean: immobileInstance, field: "id")}
								</g:link></td>
							<td style="vertical-align: middle;">
								${fieldValue(bean: immobileInstance, field: "nome")}
							</td>
							<td style="vertical-align: middle;">
								${fieldValue(bean: immobileInstance, field: "descrizione")}
							</td>

							<td style="vertical-align: middle;"><g:link controller="tipologiaImmobile" action="show"
									id="${immobileInstance?.tipologia?.id}">
									${immobileInstance?.tipologia}
								</g:link></td>
							<td style="vertical-align: middle;">
								${fieldValue(bean: immobileInstance, field: "zona")}
							</td>
							<td style="vertical-align: middle;">
								${fieldValue(bean: immobileInstance, field: "CAP")}
							</td>
							<td style="vertical-align: middle;">
								${fieldValue(bean: immobileInstance, field: "indirizzo")}
							</td>
							<td style="vertical-align: middle;">
								${fieldValue(bean: immobileInstance, field: "metriQuadri")}
							</td>
							<td style="vertical-align: middle;">
								${fieldValue(bean: immobileInstance, field: "prezzo")}
							</td>
							<td style="vertical-align: middle;"><g:link controller="agente" action="show"
									id="${immobileInstance?.agente?.id}">
									${immobileInstance?.agente}
								</g:link></td>

							<td><g:link controller="immagine" action="show"
									id="${immobileInstance?.anteprima?.id}">
									<img width="70px" height="70px" class="Photo"
										src="${createLink(controller:'site', action:'viewImage', id:immobileInstance?.anteprima?.id)}" />
								</g:link></td>

						</tr>
					</g:each>
				</tbody>
			</table>
		</div>
		<div class="paginateButtons">
			<g:paginate total="${immobileInstanceTotal}" />
		</div>

	</div>
</body>
</html>
